const files = require.context('./modules', true, /\.js$/); //批量读取模块文件
const modules = files.keys().reduce((modules, path) => {
    const name = path.replace(/^\.\/(.*)\.js$/, '$1');
    const module = files(path); 
    modules[name] = module;
    return modules;  
}, {})

export default modules